package com.mall.db.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mall.db.mapper.OmsOrderReturnReasonMapper;
import com.mall.domain.OmsOrderReturnReason;
import com.mall.interface1.api.OmsOrderReturnReasonApi;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class OmsOrderReturnReasonApiImpl implements OmsOrderReturnReasonApi {

    @Autowired
    private OmsOrderReturnReasonMapper omsOrderReturnReasonMapper;

    @Override
    public List<OmsOrderReturnReason> list(Integer pageNum, Integer pageSize) {
        Page<OmsOrderReturnReason> pageInfo = new Page<>(pageNum,pageSize);
        return omsOrderReturnReasonMapper.selectPage(pageInfo,null).getRecords();
    }

    @Override
    public Integer count() {
        return omsOrderReturnReasonMapper.selectCount(null);
    }

    //根据id获取单个退货原因详情信息
    public OmsOrderReturnReason findById(Long id) {
        return omsOrderReturnReasonMapper.selectById(id);
    }
}
